
<template>
  <div class="paycontent">
    <pay-cost-header title="预交金缴费">
      <i class="iconback"
         slot="back"
         @click="headBackClick"></i>
    </pay-cost-header>
    <h3 class="paytitle">欢迎使用青海省肿瘤医院自主缴费系统</h3>
    <div class="infobox">
      <h4>预交金缴费</h4>
      <div class="f-clear">
        <ul>
          <li>
            <em>姓名：</em>
            <span>{{infoData.name}}</span>
          </li>
          <li>
            <em>科室：</em>
            <span>{{infoData.department}}</span>
          </li>
          <li>
            <em>床号：</em>
            <span>{{infoData.bed_no}}</span>
          </li>
          <li>
            <em>入院日期：</em>
            <span>{{infoData.in_date}}</span>
          </li>
        </ul>
        <ul>
          <li>
            <em>预交金金额：</em>
            <span>{{infoData.pre_pay_balance}}</span>
          </li>
          <li>
            <em>医疗费总额：</em>
            <span>{{infoData.total_cost}}</span>
          </li>
        </ul>
      </div>
      <div class="btn">
        <a class="u-button"
           @click="payClick">缴费</a>
      </div>
    </div>
    <p class="wishtip">祝您早日康复</p>
  </div>
</template>

<script>
import urls from '../../common.js'
import PayCostHeader from '../common/PayCostHeader'
import Password from './Password'
export default {
  name: 'PrepaymentInfo',
  components: {
    PayCostHeader,
    Password
  },
  data () {
    return {
      infoData: {},
      paId: ''
    }
  },
  mounted () {
    this.patientInfo()
  },
  methods: {
    payClick () {
      this.$router.push('/premoneyset')
    },
    headBackClick () {
      this.$router.push('/')
    },
    patientInfo () {
      let _this = this
      _this.$http.post(urls.queryBalanceInfo, {
        pa_id: this.$store.state.paId,
        id_card: this.$store.state.idCard
      }).then(result => {
        if (result.body.code === '200') {
          this.infoData = result.body.data
        }
      })
    }
  }
}
</script>

<style style="stylus" scoped>
.paycontent {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: url(../../../static/images/pay/pay.png) 100% 100%;
  background-size: 100% 100%;
}
.iconback {
  display: inline-block;
  width: 0.18rem;
  height: 0.3rem;
  background: url(../../../static/images/pay/back.png) 100% 100%;
  background-size: 100% 100%;
  vertical-align: -0.04rem;
  margin-right: 0.08rem;
  cursor: pointer;
}
.paytitle {
  text-align: center;
  font-size: 0.46rem;
  color: #666;
  font-weight: bold;
  margin-top: 1rem;
  margin-bottom: 0.8rem;
}
.wishtip {
  text-align: center;
  font-size: 0.22rem;
  color: #aaa;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.35rem;
}
.infobox {
  width: 15.94rem;
  height: 6.4rem;
  border-radius: 0.2rem;
  background: #f7f8fa;
  box-shadow: 0px 11px 24px 0px rgba(127, 135, 143, 0.1);
  margin: 0 auto;
}
.infobox h4 {
  text-align: center;
  font-size: 0.3rem;
  color: #333;
  padding: 0.5rem 0 0.3rem 0;
}
.infobox ul {
  width: 50%;
  float: left;
  font-size: 0.3rem;
  padding-left: 0.6rem;
}
.infobox ul:nth-child(2) {
  padding-left: 1rem;
}
.infobox ul li {
  margin-bottom: 0.7rem;
}
.infobox ul em {
  display: inline-block;
  color: #999;
  width: 2rem;
  text-align: right;
}
.btn {
  text-align: center;
}
.u-button {
  display: inline-block;
  width: 2rem;
  height: 0.88rem;
  line-height: 0.88rem;
  text-align: center;
  border-radius: 0.12rem;
  background: #49cfbf;
  color: #fff;
}
</style>
